var lastError;

var assertNotNull = function(){
    var identify = arguments[1];
    if (identify) {
        lastError = identify;
        var callback = arguments[0];
        var args = [lastError];
        for (let argid = 2; argid < arguments.length; argid++)
            args.push(arguments[argid]);
        callback.apply(null, args);
    }
    return identify;
};

var assertNull = function(){
    var identify = arguments[1];
    if (!identify) {
        lastError = new Error('identify-expression true');
        var callback = arguments[0];
        var args = [lastError];
        for (let argid = 2; argid < arguments.length; argid++)
            args.push(arguments[argid]);
        callback.apply(null, args);
    }
    return !identify;
};
module.exports.lastError = lastError;
module.exports.assertNotNull = assertNotNull;
module.exports.assertNull = assertNull;